home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 076-100 / disk_097 / graphit / main.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  17KB  |  676 lines

  1. /****************************************************************************/
  2. /*   Program: Graph It II    (The C Program)                                    */
  3. /*   SubModule:    main.c  1-7-87                                                */
  4. /*   CopyRight By Flynn D. Fishman  January 1987                            */
  5. /*    Feel Free to copy and alter this source                                    */
  6. /****************************************************************************/
  7. /*  This module includes most of the major routines and the main loop        */
  8.  
  9. #include "graph.h"
  10.  
  11. /******************************************************/
  12. /*                   Main Program                     */
  13. /*      This is the main body of the program.         */
  14. /******************************************************/
  15.  
  16. main()
  17.     {
  18.     struct Window *Window;
  19.     struct IntuiMessage *NewMessage;
  20.     ULONG class;
  21.     USHORT code, icon_code;
  22.     SHORT x, y, x1, y1, x2, y2;
  23.     SHORT minx, miny, maxx, maxy;
  24.     USHORT MenuNum, ItemNum;
  25.     SHORT  KeepGoing, mode;
  26.     long int lastx, lasty, startx, starty;
  27.     struct Graph_Parameters        parameters;
  28.  
  29.     Window = openstuff();
  30.  
  31.     minx = Window->BorderLeft;
  32.     miny = Window->BorderTop;
  33.     maxx = Window->Width - Window->BorderRight - XBORDER;
  34.     maxy = Window->Height - Window->BorderBottom - YBORDER;
  35.  
  36.     SetDrMd( Window->RPort, JAM2 );
  37.  
  38.     KeepGoing = TRUE;
  39.     lastx    = 0;
  40.     lasty    = 0;
  41.     mode    = ZOOM;
  42.  
  43.     SetDefaults(¶meters);
  44.     parameters.xon = FALSE;
  45.     parameters.yon = FALSE;
  46.     parameters.zon = FALSE;
  47.     parameters.hidden = FALSE;
  48.  
  49.     DrawWindow(Window, ¶meters);
  50.     PrintPage(Window, 0l);
  51.     InvertIcon(Window, 1l);
  52.  
  53.     while( KeepGoing )
  54.         {
  55.         Wait( 1 << Window->UserPort->mp_SigBit);
  56.         while( NewMessage=(struct IntuiMessage *)GetMsg(Window->UserPort) )
  57.             {
  58.             class = NewMessage->Class;
  59.             code = NewMessage->Code;
  60.             x = Window->MouseX;
  61.             y = Window->MouseY;
  62.  
  63.             if( class == SIZEVERIFY )
  64.                 {
  65.                 Window->Flags &= ( 0xFFFFFFFF ^ RMBTRAP );
  66.                 }
  67.  
  68.             ReplyMsg( NewMessage );
  69.  
  70.             switch( class )
  71.                 {
  72.  
  73.                 case MENUPICK:
  74.                 if( code != MENUNULL )
  75.                     {
  76.                     /* get menu and item numbers from code */
  77.                     MenuNum = MENUNUM( code );
  78.                     ItemNum = ITEMNUM( code );
  79.  
  80.                     /* determine appropriate action by menu number */
  81.                     switch ( MenuNum )
  82.                         {
  83.                         case 0:
  84.                         switch ( ItemNum )
  85.                             {
  86.                             case 0: /* Load file */
  87.                                LoadFile(Window, ¶meters);
  88.                                DrawWindow(Window, ¶meters);
  89.                                PlotGraph(Window, ¶meters);
  90.                                DrawVariables(Window, ¶meters, mode);
  91.                             break;
  92.  
  93.                             case 1: /* save file */
  94.                                SaveFile(Window, ¶meters);
  95.                             break;
  96.  
  97.                             case 2: /* About        */
  98.                                PrintPage(Window,0l);
  99.                             break;
  100.  
  101.                             case 3:    /* Quit            */
  102.                                KeepGoing = FALSE;
  103.                             break;
  104.  
  105.                             default:
  106.                             break;
  107.  
  108.                             } /* end of menu 0 switch    */
  109.                         break;
  110.  
  111.                      case 1:
  112.                          icon_code = ItemNum+1;
  113.                         goto do_icon;
  114.                         break;
  115.  
  116.                      default:
  117.                         /* Menu number unrecognized, do nothing */
  118.                         break;
  119.  
  120.                      }    /* end of menu switch    */
  121.                 }    /* if code not menunull    */
  122.  
  123.                 case MOUSEMOVE:
  124.                  if (lastx !=0)
  125.                     {
  126.                     if (mode == ZOOM) CrossHair(Window, lastx, lasty);
  127.                     }
  128.                  if (x < maxx && x > miny + 2 && y < maxy && y > miny + 2)
  129.                     {
  130.                     lastx = x;
  131.                     lasty = y;
  132.                     if (mode == ZOOM) CrossHair(Window, lastx, lasty);
  133.                     }
  134.                  else
  135.                     lastx = 0;
  136.                 break;
  137.  
  138.                 case NEWSIZE:
  139.                  minx = Window->BorderLeft;
  140.                  miny = Window->BorderTop;
  141.                  maxx = Window->Width - Window->BorderRight - XBORDER;
  142.                  maxy = Window->Height - Window->BorderBottom - YBORDER;
  143.                  DrawWindow(Window, ¶meters);
  144.                  PlotGraph(Window, ¶meters);
  145.                 break;
  146.  
  147.                 case CLOSEWINDOW:
  148.                  KeepGoing = FALSE;
  149.                 break;
  150.  
  151.                 case MOUSEBUTTONS:
  152.                  switch ( code )
  153.                     {
  154.                     case SELECTUP:
  155.                     break;
  156.  
  157.                     case SELECTDOWN:
  158.                      if (x > maxx + YEXPANDX + 2) /* it is an icon */
  159.                         {
  160.                         icon_code = (y - miny) / (ICONY + 2);
  161. do_icon:                InvertIcon(Window, icon_code);
  162.                         switch ( icon_code )
  163.                             {
  164.                             case 1: /* Zoom Icon */
  165.                              if (mode == MOVE) DrawGrid(Window);
  166.                              mode = ZOOM;
  167.                              InvertIcon(Window, icon_code);
  168.                              InvertIcon(Window, 2l);
  169.                             break;
  170.  
  171.                             case 2: /* Move Icon */
  172.                              if (mode != MOVE) DrawGrid(Window);
  173.                              mode = MOVE;
  174.                              InvertIcon(Window, icon_code);
  175.                              InvertIcon(Window, 1l);
  176.                             break;
  177.  
  178.                             case 3: /* command line */
  179.                              if(GetCommand(Window, ¶meters) != NULL)
  180.                                  {
  181.                                 Print(Window,"Error Opening Window",0);
  182.                                 }
  183.                              DrawWindow(Window, ¶meters);
  184.                              PlotGraph(Window, ¶meters);
  185.                              DrawVariables(Window, ¶meters, mode);
  186.                             break;
  187.  
  188.                             case 4: /* Hidden lines */
  189.                              parameters.hidden =
  190.                                      (parameters.hidden) ? FALSE : TRUE;
  191.                              InvertIcon(Window, icon_code);
  192.                              if (parameters.zon)
  193.                                  {
  194.                                  DrawWindow(Window, ¶meters);
  195.                                  PlotGraph(Window, ¶meters);
  196.                                 DrawVariables(Window, ¶meters, mode);
  197.                                 }
  198.                             break;
  199.  
  200.                              case 5: /* home */
  201.                              SetDefaults(¶meters);
  202.                              DrawWindow(Window, ¶meters);
  203.                              PlotGraph(Window, ¶meters);
  204.                              DrawVariables(Window, ¶meters, mode);
  205.                             break;
  206.  
  207.                             case 6: /* quit */
  208.                              KeepGoing = FALSE;
  209.                             break;
  210.  
  211.                             case 7: /* help window */
  212.                              Help(Window, ¶meters);
  213.                              if (mode == MOVE) DrawGrid(Window);
  214.                              InvertIcon(Window, icon_code);
  215.                             break;
  216.  
  217.                             default:
  218.                             break;
  219.  
  220.                             } /* end of icon switch */
  221.                         }     /* end of icon if      */
  222.  
  223.                      else if (x > maxx)              /* It is the y-expand */
  224.                          {
  225.                         yexpand(Window, ¶meters);
  226.                         if (mode == MOVE) DrawGrid(Window);
  227.                         }
  228.  
  229.                      else if (y > maxy)              /* It is the x-expand */
  230.                          {
  231.                         xexpand(Window, ¶meters);
  232.                         if (mode == MOVE) DrawGrid(Window);
  233.                         }
  234.  
  235.                      else if (mode == ZOOM)
  236.                          {
  237.                         Zoom(Window, ¶meters, lastx, lasty);
  238.                         lastx = 0;
  239.                         }
  240.                      else if (mode == MOVE)
  241.                          {
  242.                         MoveGraph(Window, ¶meters, lastx, lasty);
  243.                         DrawGrid(Window);
  244.                         lastx = 0;
  245.                         }
  246.                     break;
  247.  
  248.                     case MENUDOWN:
  249.                     break;
  250.  
  251.                     default:
  252.                     continue;
  253.                     }
  254.                 break;
  255.  
  256.                 case INACTIVEWINDOW:
  257.                    /*   User has de-selected our window, so a
  258.                     *   little bit of cleaning up may be needed
  259.                     *   to prevent untoward events when he comes
  260.                     *   back to it.
  261.                     */
  262.                 break;
  263.  
  264.                 default:
  265.                    /* message class was unrecognized, so do nothing */
  266.                 break;
  267.                 }
  268.             }   /* this brace ends the while(NewMessage) loop way back when */
  269.         }
  270.  
  271.     /*   It must be time to quit, so we have to clean
  272.      *   up and exit.
  273.      */
  274.     if (parameters.xon) FreeFunction(parameters.x1);
  275.     if (parameters.yon) FreeFunction(parameters.y1);
  276.     if (parameters.zon) FreeFunction(parameters.z1);
  277.     closestuff(Window);
  278.     exit(TRUE);
  279.     }
  280.  
  281. PlotGraph(Window, parameters)
  282. struct Graph_Parameters *parameters;
  283. struct Window *Window;
  284.     {
  285.     extern double x,y,z,t;
  286.     long int x1, x2, y1, y2, xcenter, ycenter;
  287.     double xconversion, yconversion, steps, tsteps, loop;
  288.  
  289.     long int minx, miny, maxx, maxy;
  290.     double lastx, lasty;
  291.  
  292.     minx = Window->BorderLeft;
  293.     miny = Window->BorderTop;
  294.     maxx = Window->Width - Window->BorderRight - XBORDER;
  295.     maxy = Window->Height - Window->BorderBottom - YBORDER;
  296.  
  297. /* Draw the Graph rectangle area    */
  298.     DrawRectangle(Window, 1, minx, miny, maxx, maxy);
  299.     SetDrMd(Window->RPort, JAM2);
  300.  
  301.     if (parameters->zon) Plot3dGraph(Window, parameters);
  302.  
  303.     xconversion = (maxx - minx) / (parameters->xend - parameters->xstart);
  304.     yconversion = (maxy - miny) / (parameters->yend - parameters->ystart);
  305.  
  306.     xcenter = -parameters->xstart * xconversion + minx + 2;
  307.     ycenter = -parameters->ystart * yconversion + miny + 2;
  308.  
  309.     if (parameters->yon)
  310.         {
  311.         z = 0.0;
  312.  
  313.         if (!parameters->zon)
  314.             {
  315.             /* draw the y axis if needed    */
  316.             if (parameters->xstart * parameters->xend < 0)
  317.                 Line(Window, 2l, xcenter, miny, xcenter, maxy);
  318.             /* draw the x axis if needed    */
  319.             if (parameters->ystart * parameters->yend < 0)
  320.                 Line(Window, 2l, minx, ycenter, maxx, ycenter);
  321.             }
  322.  
  323.         if (parameters->xon)
  324.             {
  325.             tsteps= parameters->detail/(parameters->tend -parameters->tstart);
  326.             t= parameters->tstart;
  327.             parameters->x1->position = 0;
  328.             parameters->y1->position = 0;
  329.             x = Solve(parameters->x1);
  330.             y = Solve(parameters->y1);
  331.             x1 = x * xconversion + xcenter + 2;    
  332.             y1 = ycenter - y * yconversion;
  333.             lastx = x;
  334.             lasty = y;
  335.             while ( t < parameters->tend )
  336.                 {
  337.                 t += tsteps; 
  338.                 parameters->x1->position = 0;
  339.                 parameters->y1->position = 0;
  340.                 x = Solve(parameters->x1);
  341.                 y = Solve(parameters->y1);
  342.  
  343.                 x2 = x * xconversion + xcenter;    
  344.                 y2 = ycenter - y * yconversion;
  345.  
  346.                 if (parameters->zon)
  347.                     Line3d(Window, 3l, lastx, lasty, z, x, y, z);
  348.                 else Line(Window, 1l, x1, y1, x2, y2);
  349.  
  350.                 x1 = x2;
  351.                 y1 = y2;
  352.                 lastx = x;
  353.                 lasty = y;
  354.                 }    /* end of while        */
  355.             }        /* end of xon (parametric) section    */
  356.         else
  357.             {
  358.             parameters->y1->position = 0;
  359.  
  360.             x = parameters->xstart;
  361.             y = Solve(parameters->y1);
  362.             x1 = x * xconversion + xcenter + 2;    
  363.             y1 = ycenter - y * yconversion;
  364.             lastx = x;
  365.             lasty = y;
  366.             while ( x < parameters->xend )
  367.                 {
  368.                 parameters->y1->position = 0;
  369.                 x += ( (double) (parameters->detail) ) /xconversion;
  370.                 y = Solve(parameters->y1);
  371.                 x2 = x * xconversion + xcenter;    
  372.                 y2 = ycenter - y * yconversion;
  373.  
  374.                 if (parameters->zon)
  375.                         Line3d(Window, 3l, lastx, lasty, z, x, y, z);
  376.                 else Line(Window, 1l, x1, y1, x2, y2);
  377.  
  378.                 x1 = x2;
  379.                 y1 = y2;
  380.                 lastx = x;
  381.                 lasty = y;
  382.                 } /* end of while */
  383.             }     /* of xon else */
  384.         }     /* end of if     */
  385.     return();
  386.     }
  387.  
  388. Zoom(Window, parameters, firstx, firsty)
  389. struct Window *Window;
  390. struct Graph_Parameters *parameters;
  391. long int firstx, firsty;
  392.     {
  393.     long int minx, miny, maxx, maxy, lastx, lasty, x, y;
  394.     struct IntuiMessage *NewMessage;    /* msg structure for GetMsg() */
  395.     ULONG class;                        /* used in message monitor loop */
  396.     USHORT code;                        /* used in message monitor loop */
  397.  
  398.     minx = Window->BorderLeft;
  399.     miny = Window->BorderTop;
  400.     maxx = Window->Width - Window->BorderRight - XBORDER;
  401.     maxy = Window->Height - Window->BorderBottom - YBORDER;
  402.  
  403.     lastx = 0;
  404.  
  405.     for ever
  406.         {
  407.         Wait( 1 << Window->UserPort->mp_SigBit);
  408.         while( NewMessage=(struct IntuiMessage *)GetMsg(Window->UserPort) )
  409.             {
  410.             class = NewMessage->Class;
  411.             code = NewMessage->Code;
  412.             x = Window->MouseX;
  413.             y = Window->MouseY;
  414.             ReplyMsg( NewMessage );
  415.  
  416.             switch( class )
  417.                 {
  418.                 case MOUSEMOVE:
  419.                     if (lastx !=0)
  420.                         {
  421.                         CrossHair(Window, lastx, lasty);
  422.                         }
  423.                     if (x < maxx && x > miny + 2 && y < maxy && y > miny + 2)
  424.                         {
  425.                         lastx = x;
  426.                         lasty = y;
  427.                         CrossHair(Window, lastx, lasty);
  428.                         }
  429.                     else
  430.                         lastx = 0;
  431.                     break;
  432.                 break;
  433.  
  434.                 case MOUSEBUTTONS:
  435.                 switch ( code )
  436.                     {
  437.                     case SELECTUP:
  438.                     if (lastx == 0) return();
  439.                     Real(Window, parameters, firstx, firsty, lastx, lasty);
  440.                     PlotGraph(Window, parameters);
  441.                     return();
  442.                     break;
  443.  
  444.                     default:
  445.                     break;
  446.                     } /* end of mousebutton switch */
  447.  
  448.                 default:
  449.                 break;
  450.                 } /* end of the case switch    */
  451.             }
  452.         }    /* end of forever    */
  453.     }
  454.  
  455. MoveGraph(Window, parameters, firstx, firsty)
  456. struct Window *Window;
  457. struct Graph_Parameters *parameters;
  458. long int firstx, firsty;
  459.     {
  460.     long int minx, miny, maxx, maxy, deltax, deltay, x, y;
  461.     long int changex, changey;
  462.     struct IntuiMessage *NewMessage;    /* msg structure for GetMsg() */
  463.     ULONG class;                        /* used in message monitor loop */
  464.     USHORT code;                        /* used in message monitor loop */
  465.  
  466.     minx = Window->BorderLeft;
  467.     miny = Window->BorderTop;
  468.     maxx = Window->Width - Window->BorderRight - XBORDER;
  469.     maxy = Window->Height - Window->BorderBottom - YBORDER;
  470.  
  471.     changex = 0;
  472.     changey = 0;
  473.  
  474.     deltax = 1;
  475.     deltay = 1;
  476.  
  477.     if (firstx > maxx / 3 && firstx < maxx * 2 / 3) deltax = 0;
  478.     if (firsty > maxy / 3 && firsty < maxy * 2 / 3) deltay = 0;
  479.  
  480.     DrawGrid(Window);
  481.  
  482.     for ever
  483.         {
  484.         Wait( 1 << Window->UserPort->mp_SigBit);
  485.         while( NewMessage=(struct IntuiMessage *)GetMsg(Window->UserPort) )
  486.             {
  487.             class = NewMessage->Class;
  488.             code = NewMessage->Code;
  489.             x = Window->MouseX;
  490.             y = Window->MouseY;
  491.             ReplyMsg( NewMessage );
  492.  
  493.             switch( class )
  494.                 {
  495.                 case MOUSEMOVE:
  496.                     if (changex !=0 || changey != 0)
  497.                         {
  498.                         Box(Window, changex, changey);
  499.                         }
  500.                     if (x < maxx && x > miny + 2 && y < maxy && y > miny + 2)
  501.                         {
  502.                         changex = (x - firstx) * deltax;
  503.                         changey = (y - firsty) * deltay;
  504.                         Box(Window, changex, changey);
  505.                         }
  506.                     else
  507.                         changex = 0;
  508.                     break;
  509.                 break;
  510.  
  511.                 case MOUSEBUTTONS:
  512.                 switch ( code )
  513.                     {
  514.                     case SELECTUP:
  515.                     if (changex == 0 && changey == 0) return();
  516.                     Shift(Window, parameters, changex, changey);
  517.                     DrawWindow(Window, parameters);
  518.                     PlotGraph(Window, parameters);
  519.                     return();
  520.                     break;
  521.  
  522.                     default:
  523.                     break;
  524.                     }
  525.  
  526.                 default:
  527.                 break;
  528.                 }
  529.             }
  530.         }
  531.     }
  532.  
  533. xexpand(Window, parameters)
  534. struct Window *Window;
  535. struct Graph_Parameters *parameters;
  536.     {
  537.     struct IntuiMessage *NewMessage;    /* msg structure for GetMsg() */
  538.     ULONG class;                        /* used in message monitor loop */
  539.     USHORT code;                        /* used in message monitor loop */
  540.     long int minx, miny, maxx, maxy, x, y, xlast;
  541.     double xfactor, xfloat, maxfloat;
  542.  
  543.     minx = Window->BorderLeft;
  544.     miny = Window->BorderTop;
  545.     maxx = Window->Width - Window->BorderRight - XBORDER;
  546.     maxy = Window->Height - Window->BorderBottom - YBORDER;
  547.  
  548.     xlast = minx + XEXPANDX + 1;
  549.  
  550.     for ever
  551.         {
  552.         Wait( 1 << Window->UserPort->mp_SigBit);
  553.         while( NewMessage=(struct IntuiMessage *)GetMsg(Window->UserPort) )
  554.             {
  555.             class = NewMessage->Class;
  556.             code = NewMessage->Code;
  557.             x = Window->MouseX;
  558.             y = Window->MouseY;
  559.             ReplyMsg( NewMessage );
  560.  
  561.             switch( class )
  562.                 {
  563.                 case MOUSEMOVE:
  564.                 EraseButton(Window, xlast, maxy + 3);
  565.                 if ( x < minx + XEXPANDX + 1) x = minx + XEXPANDX + 1;
  566.                 if ( x > maxx - XEXPANDX - BALLWIDTH - 1)
  567.                                 x = maxx - XEXPANDX - BALLWIDTH - 1;
  568.                 xlast = x;
  569.                 DrawButton(Window, xlast, maxy + 3);
  570.                 break;
  571.  
  572.                 case MOUSEBUTTONS:
  573.                 switch ( code )
  574.                     {
  575.                     case SELECTUP:
  576.                     xfloat = xlast;
  577.                     maxfloat = maxx;
  578.                     xfactor = xfloat/ maxfloat *
  579.                                 (parameters->xend - parameters->xstart);
  580.                     parameters->xstart = parameters->xstart - xfactor;
  581.                     parameters->xend = parameters->xend +  xfactor;
  582.                     DrawWindow(Window, parameters);
  583.                     PlotGraph(Window, parameters);
  584.                     return();
  585.                     break;
  586.  
  587.                     default:
  588.                     break;
  589.                     }
  590.  
  591.                 default:
  592.                 break;
  593.                 }
  594.             }
  595.         }
  596.     }
  597.  
  598. yexpand(Window, parameters)
  599. struct Window *Window;
  600. struct Graph_Parameters *parameters;
  601.     {
  602.     struct IntuiMessage *NewMessage;    /* msg structure for GetMsg() */
  603.     ULONG class;                        /* used in message monitor loop */
  604.     USHORT code;                        /* used in message monitor loop */
  605.     long int minx, miny, maxx, maxy, x, y, ylast;
  606.     double yfactor, yfloat, maxfloat;
  607.  
  608.     minx = Window->BorderLeft;
  609.     miny = Window->BorderTop;
  610.     maxx = Window->Width - Window->BorderRight - XBORDER;
  611.     maxy = Window->Height - Window->BorderBottom - YBORDER;
  612.  
  613.     ylast = maxy - YEXPANDY - BALLHEIGHT - 1;
  614.  
  615.     for ever
  616.         {
  617.         Wait( 1 << Window->UserPort->mp_SigBit);
  618.         while( NewMessage=(struct IntuiMessage *)GetMsg(Window->UserPort) )
  619.             {
  620.             class = NewMessage->Class;
  621.             code = NewMessage->Code;
  622.             x = Window->MouseX;
  623.             y = Window->MouseY;
  624.             ReplyMsg( NewMessage );
  625.  
  626.             switch( class )
  627.                 {
  628.                 case MOUSEMOVE:
  629.                 EraseButton(Window, maxx + 3, ylast);
  630.                 if ( y < miny + YEXPANDY + 1) y = miny + YEXPANDY + 1;
  631.                 if ( y > maxy - YEXPANDY - BALLHEIGHT -1 )
  632.                                 y = maxy - YEXPANDY - BALLHEIGHT - 1;
  633.                 ylast = y;
  634.                 DrawButton(Window, maxx + 3 , ylast);
  635.                 break;
  636.  
  637.                 case MOUSEBUTTONS:
  638.                 switch ( code )
  639.                     {
  640.                     case SELECTUP:
  641.                     yfloat = maxy - ylast;
  642.                     maxfloat = maxy;
  643.                     yfactor = yfloat/ maxfloat *
  644.                                 (parameters->yend - parameters->ystart);
  645.                     parameters->ystart = parameters->ystart - yfactor;
  646.                     parameters->yend = parameters->yend + yfactor;
  647.                     DrawWindow(Window, parameters);
  648.                     PlotGraph(Window, parameters);
  649.                     return();
  650.                     break;
  651.  
  652.                     default:
  653.                     break;
  654.                     }
  655.  
  656.                 default:
  657.                 break;
  658.                 }
  659.             }
  660.         }
  661.     }
  662.  
  663. DrawVariables(Window, parameters, mode)
  664. struct Window *Window;
  665. struct Graph_Parameters *parameters;
  666. int mode;
  667.     {
  668.     if (mode == MOVE)
  669.         {
  670.         DrawGrid(Window);
  671.         InvertIcon(Window, 2l);
  672.         }
  673.     else InvertIcon(Window, 1l);
  674.     if (parameters->hidden) InvertIcon(Window, 4l);
  675.     }
  676.